/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;
import java.io.Serializable;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.EmbeddedId;
import javax.persistence.JoinColumn;
/**
 *
 * @author Elias Mendoza
 */
@Entity
@Table(name = "sustrato_nave")
@AssociationOverrides({
		@AssociationOverride(name = "primaryKey.sustratoFK", 
			joinColumns = @JoinColumn(name = "sustrato_id",referencedColumnName="id")),
		@AssociationOverride(name = "primaryKey.naveFK", 
			joinColumns = @JoinColumn(name = "nave_id",referencedColumnName="id")) })
public class SustratoNave implements Serializable{

  @EmbeddedId
  private SustratoNavePK primaryKey;
  


  public SustratoNave() {
  }

  public SustratoNave(SustratoNavePK primaryKey) {
    this.primaryKey = primaryKey;
  }

  public SustratoNavePK getPrimaryKey() {
    return primaryKey;
  }

  public void setPrimaryKey(SustratoNavePK primaryKey) {
    this.primaryKey = primaryKey;
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final SustratoNave other = (SustratoNave) obj;
    if (this.primaryKey != other.primaryKey && (this.primaryKey == null || !this.primaryKey.equals(other.primaryKey))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = 97 * hash + (this.primaryKey != null ? this.primaryKey.hashCode() : 0);
    return hash;
  }



}
